<template>
	<view style="height: 100%" @click="gongSFalse">
		<nav-bar title="编辑企业资料" @back="goBack"></nav-bar>
		<view v-if="showNoticeBar"
			:style="'width:100%;position: fixed;top:0rpx;left:0rpx;z-index:12;padding-top:' + statusBarHeight +  'px' ">
			<van-notice-bar @close="showNoticeBar = false" left-icon="volume-o" color='#283043' background='#FFFFFF'
				:scrollable="true">{{Notice}}</van-notice-bar>
		</view>

		<view :style="showNoticeBar ? ' height: 44px;': ' '"></view>
		<view class="" v-if="!info_show && submitIndex === 0">
			<ul class="db bgcf pd015">
				<li class="df ac sb h48 bbf1" style="position: relative; ">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">企业名称</p>
					<input class="tr f1 ml15 f14 c28" @input="onInputYY" :data-type="0" @focus="handleFocus"
						:style="isPassed ? '' : 'background-color: rgba(255, 0,0,0.1);'" :value="val[0]"
						placeholder="名称与营业执照一致" placeholder-class="cc" />
					<view class="passed">
						<image @click.stop="gongS" v-if="!isPassed" style="width: 100%;height: 100%;"
							src="@/static/icon/not_passed.png" mode="widthFix"></image>
						<image @click.stop="gongS" v-else style="width: 100%;height: 100%;"
							src="@/static/icon/passed.png" mode="widthFix">
						</image>
						<view v-show="gongShow" class="pd_tab">
							<image v-if="isPassed" src="../../static/已通过.png" mode="aspectFit"></image>
							<image v-else src="../../static/未通过.png" mode="aspectFit"></image>
						</view>
					</view>
					<view class="search-D" v-if="SySeach && Result && Result.length > 0">
						<view @click="SySeach=false" v-if="Result" class="" style="padding: 6px 0 6px 6px;"> 关闭 </view>
						<view v-for="(item,index) in Result" :key="index" class="">
							<view class="titleName" @click="selectName(item.Name)">
								{{item.Name}}
							</view>
						</view>
					</view>
				</li>
				<li class="df ac sb bgcf pd150 bbf1">
					<view class="">
						<view class="df ac bgcf" hover-class="none" :hover-stop-propagation="false">
							<span class="f14 cf5">*</span>
							<p class="f14 c28">营业执照</p>
						</view>
						<view class="tips cc"> 清晰完整，避免缺边、模糊、反光 </view>
					</view>
					<view class="df ac">
						<view class="img72 pr" v-if="val[1]">
							<image class="img72" referrerPolicy='no-referrer' :src="img_path + val[1]" />
							<image class="img-del" src="https://wx.xtwaixie.com/img/del.png" @tap="onDel(0)" />
						</view>
						<image class="img72" src="https://wx.xtwaixie.com/img/up.png" @tap="upImgArr(0)" v-else />
					</view>
				</li>
				<li class="df ac sb h48 bbf1">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">负责人</p>
					<input class="tr f1 ml15 f14 c28" @input="onInput" :data-type="2" :value="val[2]"
						placeholder="请填写负责人" placeholder-class="cc" />
				</li>
				<li class="df ac sb h48 bbf1">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">联系号码</p>
					<input class="tr f1 ml15 f14 c28" @input="onInput" :data-type="3" :value="val[3]" type="number"
						placeholder="请填写联系号码" placeholder-class="cc" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="getSetting" :data-type="0">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">工厂定位</p>
					<!-- <input class="tr f1 ml15 f14 c28" :value="val[4].replace(/市.*/, '市')" placeholder="请选择地区"
						placeholder-class="cc" disabled /> -->
					<view style="flex: 1;">
						<input class="tr f1 ml15 f14 c28" :value="area[0] + area[1]+area[2]" placeholder="请选择地区"
							placeholder-class="cc" disabled />
						<input class="tr f1 ml15 f14 c28" auto-height :data-type="6" :value="val[6]" placeholder="点击定位"
							placeholder-class="cc" disabled />
					</view>
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1">
					<span class="f14 cf5" style="opacity: 0;">*</span>
					<p class="f14 c28">门牌号</p>
					<input class="tr f1 ml15 f14 c28" @input="onInput" :data-type="5" :value="val[5]"
						placeholder="例: 90号3栋" placeholder-class="cc" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="changeMachining()">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">加工工艺</p>
					<input class="tr f1 ml15 f14 c28" :value="processingTechnology" placeholder="请选择加工工艺"
						placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb bbf1 f14"
					style="color:red;align-items: flex-end;height: 72rpx;padding-bottom: 6rpx;font-weight: 600">
					让采购商更好的了解您的企业，请完善以下信息 </li>
				<li class="df ac sb h48 bbf1" @tap.native="changeMaterials()">
					<span class="f14 cf5" style="opacity: 0;">*</span>
					<p class="f14 c28">加工材料</p>
					<input class="tr f1 ml15 f14 c28" :value="materials" placeholder="请选择加工材料" placeholder-class="cc"
						disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showOrderType = true">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">可接受订单类型</p>
					<input class="tr f1 ml15 f14 c28" :value="orderType" placeholder="请选择可接受订单类型" placeholder-class="cc"
						disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showAccountingPeriod = true">
					<span class="f14 cf5" style="opacity: 0;">*</span>
					<p class="f14 c28">能接受账期的情况</p>
					<input class="tr f1 ml15 f14 c28" :value="accountingPeriod" placeholder="请选择能接受账期的情况"
						placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showEmployeesNum = true">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">员工数量</p>
					<input class="tr f1 ml15 f14 c28"
						:value="employeesNum === -1 ? '' : employeesNumList[employeesNum].text" placeholder="请选择员工数量"
						placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showYearNum = true">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">年产值</p>
					<input class="tr f1 ml15 f14 c28" :value="yearNum === -1 ? '' : yearNumList[yearNum].text"
						placeholder="请选择年产值" placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showAreaNum = true">
					<span class="f14 cf5">*</span>
					<p class="f14 c28">工厂面积</p>
					<input class="tr f1 ml15 f14 c28" :value="areaNum === -1 ? '' : areaNumList[areaNum].text"
						placeholder="请选择工厂面积" placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb bbf1" style="min-height: 96rpx;" @tap.native="showServiceIndustry = true">
					<span class="f14 cf5" style="opacity: 0;">*</span>
					<p class="f14 c28">行业领域</p>
					<input class="tr f1 ml15 f14 c28" :value="serviceIndustry" placeholder="如：汽车、农机、医疗、航天航空等"
						placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" @tap.native="showCertificate = true">
					<span class="f14 cf5" style="opacity: 0;">*</span>
					<p class="f14 c28">拥有的资质证书</p>
					<input class="tr f1 ml15 f14 c28" :value="certificate" placeholder="请选择拥有的资质证书"
						placeholder-class="cc" disabled />
					<image class="img14 ml8" src="https://wx.xtwaixie.com/img/more1.png" />
				</li>
				<li class="df ac sb h48 bbf1" style="margin-bottom: 80rpx;">
					<view class="ac df">
						<span class="f14 cf5" style="opacity: 0;">*</span>
						<p class="f14 c28">有无进出口权</p>
					</view>
					<ul class="df">
						<li class="df ac ml24" @tap.native="exportRights = 1" data-i="0" data-act="1">
							<image class="img18" referrerPolicy='no-referrer'
								:src="exportRights == 1 ? 'https://wx.xtwaixie.com/img/sel1.png' : 'https://wx.xtwaixie.com/img/sel2.png'">
							</image>
							<p class="f14 c28 ml8">有</p>
						</li>
						<li class="df ac ml24" @tap.native="exportRights = 2" data-i="0" data-act="2">
							<image class="img18" referrerPolicy='no-referrer'
								:src="exportRights == 2 ? 'https://wx.xtwaixie.com/img/sel1.png' : 'https://wx.xtwaixie.com/img/sel2.png'">
							</image>
							<p class="f14 c28 ml8">无</p>
						</li>
					</ul>
				</li>
			</ul>
			<view class="pd15 mt15" hover-class="none" :hover-stop-propagation="false">
				<button class="sub" @tap="nextPage"><span>下一页
					</span><span>(1/2)</span></button>
			</view>
		</view>
		<view class="" v-else-if="!info_show && submitIndex === 1">
			<ul class="db bgcf pd015">
				<view class="df ac h40 f16 c6b" style="background-color: #f7f8fc;padding-left: 10rpx;">设备清单<p
						class="red f12" style="margin-left: 10rpx;">(让采购商了解您的加工实力)</p>
				</view>
				<view class="" v-for="(item,index) in equipmentList" :key="index">
					<li class="df ac sb h48">
						<p class="f14" style="color: #1050c7;">设备{{ index + 1 }}</p>
					</li>
					<li class="df ac sb bbf1" style="padding-bottom: 20rpx;">
						<view style="margin-right: 10rpx;margin-top: 20rpx;">
							<image src="https://cdn.xtwaixie.com/uploads/20240822/172431033266c6e33c46f61.png"
								mode="heightFix" style="height: 40rpx;width: auto;vertical-align: bottom;"
								@tap="deleteList(index)">
							</image>
						</view>
						<view class="f1 df">
							<view class="ac sb h48" style="width: 35%;margin-right: 10rpx;">
								<view class="f14 tc">
									<span class=" cf5">*</span>设备
								</view>
								<input class="tl f1 f14 c28 input" @input="equipmentInput('name',$event,index)"
									:value="item.name" placeholder-class="cc" />
							</view>
							<view class="ac sb h48" style="width: 25%;margin-right: 10rpx;">
								<view class="f14 tc">
									<span>型号</span>
								</view>
								<input class="tl f1 f14 c28 input" @input="equipmentInput('model',$event,index)"
									:value="item.model" placeholder-class="cc" />
							</view>
							<view class="ac sb h48" style="width: 22%;margin-right: 10rpx;">
								<view class="f14 tc">
									<span>品牌</span>
								</view>
								<input class="tl f1 f14 c28 input" @input="equipmentInput('brand',$event,index)"
									:value="item.brand" placeholder-class="cc" />
							</view>
							<view class="ac sb h48" style="width: 18%">
								<view class="f14 tc">
									<span class=" cf5">*</span>数量
								</view>
								<input class="tl f1 f14 c28 input" @input="equipmentInput('number',$event,index)"
									:value="item.number" placeholder-class="cc" type="number" />
							</view>
						</view>
					</li>
				</view>
				<view class="df" style="padding:0 0 20rpx;justify-content: center;">
					<view class="df ac jc bgcf" @tap="onAdd"
						style="border: 1px dashed #1050c7;border-radius: 15rpx;margin: 20rpx 0;padding: 10rpx 20rpx;">
						<image class="img24" src="https://wx.xtwaixie.com/img/add3.png"></image>
						<p class="f16 c10 ml4">添加设备</p>
					</view>
				</view>
				<view class="df ac h40 f16 c6b"
					style="background-color: #f7f8fc;padding-left: 10rpx;margin-top: 60rpx;">合作客户 </view>
				<view class="" v-for="(item,index) in equipmentLists" :key="index">
					<li class="df ac sb h48">
						<p class="f14" style="color: #1050c7;">客户{{ index + 1 }}</p>
					</li>
					<view class="f14 tc" style="margin-right: 10px;">
						<span class=" cf5"></span> <!-- {{JSON.stringify(item)}} -->
					</view>
					<view class="f1 df">
						<view class="ac sb h48"
							style="width: 100%;margin-right: 10rpx;display: flex;align-items: center;">
							<view style="margin-right: 10rpx;margin-bottom: 10rpx;display: inline; "
								@tap="deleteLists(index)">
								<image src="https://cdn.xtwaixie.com/uploads/20240822/172431033266c6e33c46f61.png"
									mode="heightFix" style="height: 40rpx;width: auto;vertical-align: bottom;">
								</image>
							</view>
							<input class="tl f1 f14 c28 input" style="width: 100%;"
								@input="equipmentInputs('name',$event,index)" :value="item.name"
								placeholder-class="cc" />
						</view>
					</view>
				</view>
				<view class="df" style="padding:0 0 20rpx;justify-content: center;">
					<view class="df ac jc bgcf" @tap="onAddS"
						style="border: 1px dashed #1050c7;border-radius: 15rpx;margin: 20rpx 0;padding: 10rpx 20rpx;">
						<image class="img24" src="https://wx.xtwaixie.com/img/add3.png"></image>
						<p class="f16 c10 ml4">添加客户</p>
					</view>
				</view>
				<p class="df ac h40 f16 c6b"
					style="background-color: #f7f8fc;margin-bottom: 20rpx;padding-left: 10rpx;">公司简介</p>
				<textarea class="db h110 pt15 f14 input" style="width: calc(100% - 20rpx)" @input="onInputIntroduction"
					:value="companyIntroduction" placeholder-class="cc"
					placeholder="例:苏州XX精密加工有限公司成立于2016年，位于江苏省苏州市相城区XX路XX号X栋，是一家专注五金产品(不锈钢铝。铜等)设计、加工于一体的生产制造企业，通过XX认证，获得XX荣誉，拥有XX专利，可对外CNC、车床等加工，可来图定制加工，可快速打样，欢迎来图询价!"></textarea>
				<view class="" style="height: 80rpx;">
				</view>
			</ul>
			<view class="pd15 mt15" hover-class="none" :hover-stop-propagation="false">
				<button class="sub"
					@tap="onSub"><span>{{info.status == 1 || info.status == 3 || info.status == 2 ? '重新提交' : '提交'}}</span><span>(2/2)</span></button>
			</view>
			<view class="caiJ" v-if="caijiIMg">
				<view class="container" style="height: 90vh;width: 100%;margin: 0 0;">
					<bt-cropper ref="cropper" quality :ratio="16/9" :imageSrc="img_path + JIeq"
						:dWidth="0"></bt-cropper>
					<!-- <okingtz-cropper ></okingtz-cropper> -->
					<view class="CQbutton">
						<button @click="cancellation">取消</button>
						<button style="color: red;" @click="crop">确定</button>
					</view>
				</view>
			</view>
			<view class="caiJ" v-if="caijiIMg2">
				<view class="container" style="height: 90vh;width: 100%;margin: 0 0;">
					<bt-cropper ref="cropper" quality :ratio="1/1" :imageSrc="img_path + JIeq" :dWidth="0"></bt-cropper>
					<!-- <okingtz-cropper ></okingtz-cropper> -->
					<view class="CQbutton">
						<button @click="cancellation2">取消</button>
						<button style="color: red;" @click="crop2">确定</button>
					</view>
				</view>
			</view>
		</view>
		<!-- 提交过 -->
		<view class="pd15" v-if="info_show">
			<view class="pd015 bgcff7 br12">
				<view class="df ac sb pd150 bbf1">
					<p class="f14 c9d">申请时间：{{ info.created_at }}</p>
					<p class="f14 f500 c10" v-if="info.my_status == 1">审核中</p>
					<p class="f14 f500 cf5" v-if="info.my_status == 3">未通过</p>
					<p class="f14 f500 c3a" v-if="info.my_status == 2">已通过</p>
				</view>
				<view class="pd150">
					<h2 class="c28 f18 f600 db">{{ info.company }}</h2>
					<view class="df ac sb">
						<ul class="db f1">
							<li class="db f14 c9d mt5">地区：{{ info.city }}</li>
							<li class="db f14 c9d mt5">负责人：{{ info.person }}</li>
						</ul>
						<image class="img72 br6" @tap.stop.prevent="preview" referrerPolicy='no-referrer'
							:src="info.business_license_show" :data-src="info.business_license_show"></image>
					</view>
				</view>
				<view class="bh mt12" v-if="info.reason && info.my_status == 3">原因：{{ info.reason }}</view>
			</view>
			<view class="pob pd715 mb20">
				<button class="sub" v-if="info.my_status != 1" @tap="onAgain">重新提交</button>
				<button class="sub" v-else @tap="onBack">返回</button>
			</view>
		</view>
		<van-popup :show="showNotice" @close="onClose" custom-style='background:#00000000;'>
			<image src="https://cdn.xtwaixie.com/uploads/20240415/1713170369661ce7c10e9d1.gif" mode="widthFix"
				style="width: 500rpx;padding-bottom: 600rpx;"></image>
		</van-popup>
		<van-popup :show="show" round @close="show = false">
			<p class="df ac jc pd200 mt5 w311">
				<span class="f16 c28 f500 tc" style="padding: 0px 30rpx;">确认提交？</span>
			</p>
			<view class="df ac btf1 h48 mt15">
				<p class="w50 tc f16 c28" @tap.native="show = false">否</p>
				<button class="share-but1 h48 c10" @tap="getSubmit">是</button>
			</view>
		</van-popup>
		<van-popup :show="showTechnology" position="bottom" round @close='showTechnology = false'>
			<view class="" style="width: 100vw;height: 840rpx;border-radius: 0;">
				<technology :lists="bese_info.machining" v-if="showTechnology" @agree="agree"
					:technologyList='productIndex === -1 ? machiningList : productList[productIndex].machining_id' />
			</view>
		</van-popup>
		<van-popup :show="showOrderType" position="bottom" round @close="agreeOrderType('type')">
			<view class="xPopupTitle"> 可接受订单类型 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in typeList" :key="index" @tap="checkType(item.value,'type')"
					:class="{choosedType:choosedType(item.value,'type')}">
					{{ item.text }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('type')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showEmployeesNum" position="bottom" round @close='showEmployeesNum = false'>
			<van-picker show-toolbar title="员工数量" :default-index="employeesNum" :columns="employeesNumList"
				@confirm="employeesNumConfirm" @cancel="cancel" />
		</van-popup>
		<van-popup :show="showYearNum" position="bottom" round @close='showYearNum = false'>
			<van-picker show-toolbar title="年产值" :columns="yearNumList" @confirm="yearNumConfirm" @cancel="cancel" />
		</van-popup>
		<van-popup :show="showAreaNum" position="bottom" round @close='showAreaNum = false'>
			<van-picker show-toolbar title="工厂面积" :columns="areaNumList" @confirm="areaNumConfirm" @cancel="cancel" />
		</van-popup>
		<van-popup :show="showAccountingPeriod" position="bottom" round @close="agreeOrderType('period')">
			<view class="xPopupTitle"> 能接受账期的情况 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in periodList" :key="index" @tap="checkType(item.value,'period')"
					:class="{choosedType:choosedType(item.value,'period')}">
					{{ item.text }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('period')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showMaterial" position="bottom" round @close="agreeOrderType('materials')">
			<view class="xPopupTitle"> 加工材料 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in materialList" :key="index" @tap="checkType(item.id,'materials')"
					:class="{choosedType:choosedType(item.id,'materials')}">
					{{ item.name }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('materials')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showTipImage" round @close="showTipImage=false">
			<view style="margin-bottom:200rpx">
				<image style="width:659rpx;height:679rpx;"
					:src="getImgSrc('/uploads/20250226/174055682767beca1b540ca.png')"></image>
			</view>
		</van-popup>
		<van-popup :show="showMaterial2" position="bottom" round @close="agreeOrderType('materials2')">
			<view class="xPopupTitle"> 产品材料 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in materialList" :key="index" @tap="checkType(item.id,'materials2')"
					:class="{choosedType:choosedType(item.id,'materials2')}">
					{{ item.name }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('materials2')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showCertificate" position="bottom" round @close="agreeOrderType('certificate')">
			<view class="xPopupTitle"> 资质证书 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in qualification" :key="index"
					@tap="checkType(item.id,'certificate')" :class="{choosedType:choosedType(item.id,'certificate')}">
					{{ item.name }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('certificate')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showServiceIndustry" position="bottom" round @close="agreeOrderType('service_industry')">
			<view class="xPopupTitle"> 服务行业 </view>
			<view class="selectBox">
				<view class="" v-for="(item,index) in service_industry" :key="index"
					@tap="checkType(item.id,'service_industry')"
					:class="{choosedType:choosedType(item.id,'service_industry')}">
					{{ item.name }}
				</view>
			</view>
			<view class="submitBtn" @click="agreeOrderType('service_industry')">
				<view> 确定 </view>
			</view>
		</van-popup>
		<van-popup :show="showBack" round @close="showBack = false">
			<p class="db pd200 mt5 w311">
				<span class="f20 c28 f500 db tc">提示</span>
				<span class="f16 db tc mt8">是否保存编辑</span>
			</p>
			<view class="df ac btf1 h48">
				<button class="share-but1 h48" @tap.native="submitBack(false)">不保存</button>
				<button class="share-but1 h48 c10" @tap="submitBack(true)">保存</button>
			</view>
		</van-popup>
		<toast :value='showToast' title='微信禁止电脑端小程序上传文件' :ifHtml='true'
			content='1、可将文件发送至“文件传输助手”微信，通过手机上传文件发布。<br/>2、不上传文件发布。后添加微信xtwaixie，平台补充上传图纸文件。' btnText='知道了'
			@change='showToast=false' />
		<canvas canvas-id="canvas"
			:style="{ height: cHeight + 'px',position: 'absolute', left: '-1000px',width:cWidth+ 'px',zIndex:-999 }"></canvas>
	</view>
</template>
<script>
	import {
		technology
	} from "@/component/technology.vue"
	import {
		toast
	} from "@/component/toast.vue"
	import areaList from '../../utils/area';
	import NavBar from '@/component/nav-bar.vue';
	import OkingtzCropper from '@/uni_modules/okingtz-cropper/components/okingtz-cropper/okingtz-cropper'
	const http = require('../../utils/http');

	export default {
		components: {
			NavBar,
			technology,
			toast,
			OkingtzCropper
		},
		data() {
			return {
				showTipImage: false,
				JIeq: '',
				uniImage: null,
				caijiIMg: false,
				SySeach: false,
				showNoticeBar: true,
				statusBarHeight: 0,
				showToast: false,
				showBack: false,
				productIndex: -1,
				submitIndex: 0,
				logoUrl: '',
				processingTechnology: '',
				orderType: '',
				yearNum: -1,
				areaNum: -1,
				accountingPeriod: "",
				exportRights: 0,
				materials: "",
				equipmentList: [{
					name: '',
					model: '',
					brand: '',
					number: ''
				}],
				em: [{
					name: "2222222yyy",
				}, {
					name: "收到回电话",
				}, {
					name: "444收到回电话"
				}],
				equipmentLists: [{
					name: '',
				}],
				employeesNum: -1,
				certificate: '',
				productList: [{
					name: '',
					machining: '',
					machining_id: [],
					material: '',
					material_id: [],
					url: ''
				}],
				serviceIndustry: '',
				imgList: [],
				uploadList: [],
				machiningList: [],
				showTechnology: false,
				showOrderType: false,
				showEmployeesNum: false,
				showYearNum: false,
				showAreaNum: false,
				showAccountingPeriod: false,
				showMaterial: false,
				showCertificate: false,
				showServiceIndustry: false,
				typeList: [],
				periodList: [],
				employeesNumList: [],
				yearNumList: [],
				areaNumList: [],
				materialList: [],
				typeChecked: [],
				periodChecked: [],
				materialsChecked: [],
				qualification: [],
				service_industry: [],
				certificateChecked: [],
				serviceIndustryChecked: [],
				show: false,
				time: -1,
				show_list: [false, false, false],
				areaList: areaList.areaList,
				area: ['', '', ''],
				type_val: '',
				type_id: '',
				material: '',
				material_id: '',
				val: ['', '', '', '', '', '', ''],
				act: '',
				img_path: '',
				info: {
					created_at: '',
					status: 0,
					company: '',
					city: '',
					person: '',
					business_license_show: '',
					reason: ''
				},
				info_show: false,
				material_val: '',
				showNotice: false,
				bese_info: {
					machining: '',
					range: ''
				},
				latitude: '',
				longitude: '',
				companyIntroduction: '',
				doorboard: '',
				equipment_img: [],
				equipmentImgList: [],
				showMaterial2: false,
				fileList: [],
				cWidth: 0,
				cHeight: 0,
				isPassed: false,
				passed: false,
				Notice: '',
				Result: [],
				selectedName: "",
				showS: false,
				basicAddress: '',
				basicName: '',
				basicOperName: '',
				basicEconKind: '',
				basicStartDate: "",
				basicRegistCapi: "",
				basicCreditCode: "",
				basicStatus: "",
				basicRecCap: "",
				basicNo: '',
				basicScope: "",
				basicNo: "",
				basicResultS: [],
				timer: null,
				gongShow: false,
				caijiIMg2: false,
				isPc: false,
			};
		},
		components: {
			technology,
		},
		/**
		 * 生命周期函数--监听页面加载
		 */
		onLoad(options) {
			uni.setStorageSync("platform", uni.getSystemInfoSync().platform);
			if (["windows", "mac"].some((v) => v == uni.getStorageSync("platform"))) {
				this.isPc = true
			}
			this.statusBarHeight = uni.getSystemInfoSync()['statusBarHeight'] + 40
			this.setData({
				area: uni.getStorageSync('top_area') || ['', '', ''],
				img_path: http.img_path
			});
			let token = uni.getStorageSync('token');
			if (!token) {
				let is_login = uni.getStorageSync('is_login');
				if (!is_login) {
					uni.navigateTo({
						url: '/pages/login/login'
					})
					return
				}
			}
			let data = uni.getStorageSync('settledData')
			if (data) {
				let that = this;
				uni.showModal({
					title: '提示',
					content: '是否使用上次保存信息',
					cancelText: '取消',
					confirmText: '使用',
					success: function(res) {
						if (res.confirm) {
							// that.getBase()
							that.getBase(JSON.parse(data))
							that.BaoC(data)
							console.log(that.val[0]);
						} else {
							// that.getBase()
							uni.removeStorageSync('settledData')
						}
					},
				})
			} else {
				this.getBase();
			}
			http.request('base/getconfig', {
				name: "detailed_information_announcem"
			}).then((res) => {
				console.log(res);
				this.Notice = res.data.info.remark
				console.log(res.data.info.remark);
			}).catch((res) => {
				console.log(res);
			});
			if (this.val[0]) {
				console.log(this.val[0]);
				console.log('一月又一月');
			}
		},
		/**
		 * 生命周期函数--监听页面初次渲染完成
		 */
		onReady() {},
		/**
		 * 生命周期函数--监听页面显示
		 */
		onShow() {
			// this.isPCd()
			// let is_login = uni.getStorageSync('is_login');
			// if (is_login) {
			// 	this.getBase();
			// }
		},
		/**
		 * 生命周期函数--监听页面隐藏
		 */
		onHide() {},
		/**
		 * 生命周期函数--监听页面卸载
		 */
		onUnload() {},
		/**
		 * 页面相关事件处理函数--监听用户下拉动作
		 */
		onPullDownRefresh() {},
		/**
		 * 页面上拉触底事件的处理函数
		 */
		onReachBottom() {},
		/**
		 * 用户点击右上角分享
		 */
		onPageScroll(e) {
			this.SySeach = false
			// this.isPassed=false
		},
		onShareAppMessage() {},
		methods: {
			isPCd() {
				console.log(uni.getStorageSync(), 1212)
				if (["windows", "mac"].some((v) => v == uni.getStorageSync("platform"))) {
					this.isPc = true
					console.log(this.isPC)
				}
				// return false;
			},
			cancellation() {
				this.caijiIMg = false
			},
			cancellation2() {
				this.caijiIMg2 = false
			},
			crop() {
				// 通过组件定义的ref调用cropper方法，返回一个promise对象
				this.$refs.cropper.crop().then((res) => {
					console.log(res)
					this.caijiIMg = false
					let that = this
					http.upLoadFile('base/uploadImg', 'image', res, {}).then((res) => {
						that.doorboard = res.data.url
						console.log(2);
						return
					}).catch((res) => {
						uni.showToast({
							title: res.message,
							icon: 'none'
						});
					});
				})
			},
			crop2() {
				this.$refs.cropper.crop().then((res) => {
					console.log(res)
					this.caijiIMg2 = false
					let that = this
					http.upLoadFile('base/uploadImg', 'image', res, {}).then((res) => {
						that.logoUrl = res.data.url
						console.log(2);
						return
					}).catch((res) => {
						uni.showToast({
							title: res.message,
							icon: 'none'
						});
					});
				})
			},
			gongSFalse() {
				this.gongShow = false
			},
			gongS() {
				this.true
				this.gongShow = !this.gongShow;
			},
			BaoC(data) {
				let yyys = JSON.parse(data)
				let uuuu = yyys.basic
				console.log(uuuu, 'uuuu')
				let uuuwwww = null
				if (uuuu) {
					uuuwwww = uuuu
				}
				this.isPassed = true
				if (uuuwwww) {
					this.basicResultS = uuuwwww
					this.basicAddress = uuuwwww.Address
					this.basicName = uuuwwww.Name
					this.basicOperName = uuuwwww.OperName
					this.basicEconKind = uuuwwww.EconKind
					this.basicStartDate = uuuwwww.StartDate
					this.basicRegistCapi = uuuwwww.RegistCapi
					this.basicCreditCode = uuuwwww.CreditCode
					this.basicStatus = uuuwwww.Status
					this.basicRecCap = uuuwwww.RecCap
					this.basicScope = uuuwwww.Scope
					this.basicNo = uuuwwww.basicNo
				}
			},
			toggleS() {
				this.showS = true
			},
			selectName(name) {
				this.SySeach = false
				this.isPassed = true
				this.setData({
					[`val[${0}]`]: name
				});
			},
			checkPassed() {
				this.isPassed = !this.isPassed;
				this.passed = true;
				// setTimeout(()=> this.passed = false ,1000)
			},
			submitBack(status) {
				if (status) {
					console.log(this.isPassed);
					console.log(this.equipmentLists)
					let that = this;
					let data = {
						basic: this.basicResultS,
						company: this.val[0],
						business_license: this.val[1],
						province: this.area[0],
						county: this.area[2],
						city: this.area[1],
						person: this.val[2],
						mobile: this.val[3],
						address_title: this.val[6],
						address: this.val[4],
						house_number: this.val[5],
						latitude: this.latitude ? this.latitude : this.val[7],
						longitude: this.longitude ? this.longitude : this.val[8],
						logo: this.logoUrl,
						machining_id: this.machiningList,
						order_type: this.typeChecked,
						employeesNum: this.employeesNum,
						yearNum: this.yearNum,
						areaNum: this.areaNum,
						account_period_range: this.periodChecked,
						import_export_power: this.exportRights,
						processing_materials: this.materialsChecked,
						equipment: this.equipmentList,
						clientinfo: this.equipmentLists,
						qualification_id: this.certificateChecked,
						service_industry: this.serviceIndustryChecked,
						main_products: this.productList,
						doorboard: this.doorboard,
						equipment_img: this.equipment_img,
						company_environment: this.imgList,
						introduction: this.companyIntroduction,
						file_list: this.fileList,
						states: this.isPassed
					};
					uni.setStorageSync('settledData', JSON.stringify(data))
				}
				// 返回上一页
				// uni.navigateBack({
				// 	delta: 1
				// });
				// 返回我的页面
				uni.reLaunch({
					url: '/pages/my/my'
				})
			},
			goBack() {
				if (this.info_show) {
					// 返回上一页
					// return uni.navigateBack({
					// 	delta: 1
					// });
					return uni.reLaunch({
						url: '/pages/my/my'
					})
				}
				if (this.submitIndex === 1) {
					this.submitIndex = 0;
				} else {
					this.showBack = true
				}
			},
			projuctInput(index, e) {
				this.productList[index].name = e.detail.value
			},
			cancel() {
				this.showYearNum = false
				this.showEmployeesNum = false
				this.showAreaNum = false
			},
			areaNumConfirm(e) {
				this.areaNum = e.detail.index
				this.cancel()
			},
			employeesNumConfirm(e) {
				this.employeesNum = e.detail.index
				this.cancel()
			},
			yearNumConfirm(e) {
				this.yearNum = e.detail.index
				this.cancel()
			},
			changeMachining(productIndex = -1) {
				this.productIndex = productIndex
				this.showTechnology = true
			},
			changeMaterials() {
				this.productIndex = -1
				this.showMaterial = true
			},
			changeMaterials2(productIndex) {
				this.productIndex = productIndex
				this.showMaterial2 = true
			},
			equipmentInput(type, e, index) {
				this.equipmentList[index][type] = e.detail.value
			},
			equipmentInputs(type, e, index) {
				this.equipmentLists[index][type] = e.detail.value
				// console.log(this.equipmentLists)
			},
			agreeOrderType(type) {
				console.log(type);
				let nameList = []
				if (type == 'type') {
					this.typeList.forEach((item, index) => {
						if (this.typeChecked.includes(item.value)) {
							nameList.push(item.text)
						}
					})
					this.orderType = nameList.join("、")
					this.showOrderType = false
				} else if (type == 'materials') {
					this.materialList.forEach((item, index) => {
						if (this.materialsChecked.includes(item.id)) {
							nameList.push(item.name)
						}
					})
					this.materials = nameList.join("、")
					this.showMaterial = false
				} else if (type == 'materials2') {
					this.materialList.forEach((item, index) => {
						if (this.productList[this.productIndex].material_id.includes(item.id)) {
							nameList.push(item.name)
						}
					})
					this.productList[this.productIndex].material = nameList.join("、")
					this.showMaterial2 = false
				} else if (type == 'certificate') {
					this.qualification.forEach((item, index) => {
						if (this.certificateChecked.includes(item.id)) {
							nameList.push(item.name)
						}
					})
					this.certificate = nameList.join("、")
					this.showCertificate = false
				} else if (type == 'service_industry') {
					this.service_industry.forEach((item, index) => {
						if (this.serviceIndustryChecked.includes(item.id)) {
							nameList.push(item.name)
						}
					})
					this.serviceIndustry = nameList.join("、")
					this.showServiceIndustry = false
				} else {
					this.periodList.forEach((item, index) => {
						if (this.periodChecked.includes(item.value)) {
							nameList.push(item.text)
						}
					})
					this.accountingPeriod = nameList.join("、")
					this.showAccountingPeriod = false
				}
			},
			checkType(id, type) {
				console.log(id, type)
				if (type == 'period') {
					if (this.periodChecked.includes(id)) {
						this.periodChecked = this.periodChecked.filter(res => res != id)
					} else {
						this.periodChecked.push(id)
					}
				} else if (type == 'materials') {
					console.log(this.materialsChecked);
					if (this.materialsChecked.includes(id)) {
						this.materialsChecked = this.materialsChecked.filter(res => res != id)
					} else {
						this.materialsChecked.push(id)
					}
				} else if (type == 'materials2') {
					if (this.productList[this.productIndex].material_id.includes(id)) {
						this.productList[this.productIndex].material_id = this.productList[this.productIndex].material_id
							.filter(res => res != id)
					} else {
						this.productList[this.productIndex].material_id.push(id)
					}
				} else if (type == 'certificate') {
					if (this.certificateChecked.includes(id)) {
						this.certificateChecked = this.certificateChecked.filter(res => res != id)
					} else {
						this.certificateChecked.push(id)
					}
				} else if (type == 'service_industry') {
					if (this.serviceIndustryChecked.includes(id)) {
						this.serviceIndustryChecked = this.serviceIndustryChecked.filter(res => res != id)
					} else {
						this.serviceIndustryChecked.push(id)
					}
				} else if (type == 'type') {
					console.log(this.typeChecked);
					if (this.typeChecked.includes(id)) {
						this.typeChecked = this.typeChecked.filter(res => res != id)
					} else {
						this.typeChecked.push(id)
					}
				}
			},
			choosedType(id, type) {
				let result = false
				if (type == 'materials') {
					result = this.materialsChecked.includes(id)
				} else if (type == 'period') {
					result = this.periodChecked.includes(id)
				} else if (type == 'materials2' && this.productIndex > -1) {
					result = this.productList[this.productIndex].material_id.includes(id)
				} else if (type == 'certificate') {
					result = this.certificateChecked.includes(id)
				} else if (type == 'service_industry') {
					result = this.serviceIndustryChecked.includes(id)
				} else {
					result = this.typeChecked.includes(id)
				}
				return result
			},
			agree(id, name) {
				if (this.productIndex === -1) {
					this.machiningList = id
					this.processingTechnology = name.join('、')
				} else {
					this.productList[this.productIndex].machining_id = id
					this.productList[this.productIndex].machining = name.join('、')
				}
				this.showTechnology = false
			},
			onAddProject() {
				this.productList.push({
					name: '',
					machining: '',
					machining_id: [],
					material: '',
					material_id: [],
					url: ''
				})
			},
			deleteProject(index) {
				this.productList = this.productList.filter((x, y) => y != index)
			},
			deleteList(index) {
				// console.log(this.equipmentList);
				this.equipmentList = this.equipmentList.filter((x, y) => y != index)
			},
			deleteLists(index) {
				// console.log(this.equipmentLists);
				this.equipmentLists = this.equipmentLists.filter((x, y) => y != index)
			},
			getSetting() {
				const _this = this
				uni.getSetting({
					success(res) {
						console.log('获取位置');
						if (!res.authSetting['scope.userLocation']) {
							uni.authorize({
								scope: 'scope.userLocation',
								success() {
									_this.chooseLoction()
								},
								fail() {
									uni.showModal({
										title: '请求授权当前位置',
										content: '需要获取您的地理位置，请确认授权',
										success(res) {
											if (res.cancel) {
												//用户拒绝授权
												return uni.showToast({
													title: '拒绝授权获取地址信息',
													icon: 'none'
												});
											} else if (res.confirm) {
												uni.openSetting({
													success(res) {
														console.log(res)
														if (res.authSetting[
																'scope.userLocation']) {
															_this.chooseLoction()
														} else {
															return uni.showToast({
																title: '拒绝授权获取地址信息',
																icon: 'none'
															});
														}
													},
													fail() {
														console.log(111)
														return uni.showToast({
															title: '拒绝授权获取地址信息',
															icon: 'none'
														});
													}
												})
											}
										}
									})
								}
							})
						} else {
							_this.chooseLoction()
						}
					}
				})
			},
			chooseLoction() {
				let that = this;
				uni.chooseLocation({
					success: function(res) {
						that.val[4] = res.address;
						that.val[6] = res.name;
						that.latitude = res.latitude;
						that.longitude = res.longitude;
						const requestPromise = new Promise((resolve, reject) => {
							uni.request({
								url: "https://apis.map.qq.com/ws/geocoder/v1/?location=",
								data: {
									key: "XUDBZ-3OVAL-KWEPB-MXU6W-KW4XK-6WBHF",
									location: `${res.latitude},${res.longitude}`
								},
								success: (res) => {
									console.log(res);
									console.log(res.data.result.address_component
										.province);
									resolve(res);
								},
								fail: (err) => {
									reject(err);
								}
							});
						});
						requestPromise.then((res) => {
							that.setData({
								['area[0]']: res.data.result.address_component.province,
								['area[1]']: res.data.result.address_component.city,
								['area[2]']: res.data.result.address_component.district,
							});
						}).catch((err) => {
							return uni.showToast({
								title: '打开地图失败',
								icon: 'none'
							});
						});
					},
					fail(err) {
						return uni.showToast({
							title: '打开地图失败',
							icon: 'none'
						});
					}
				});
			},
			// 添加设备
			onAdd() {
				this.equipmentList.push({
					name: '',
					model: '',
					brand: '',
					number: ''
				})
			},
			onAddS() {
				this.equipmentLists.push({
					name: '',
				})
			},
			nextPage() {
				try {
					if (!this.val[0]) {
						uni.showToast({
							title: '请输入企业名称',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[1]) {
						uni.showToast({
							title: '请上传营业执照',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[2]) {
						uni.showToast({
							title: '请输入负责人',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[3]) {
						uni.showToast({
							title: '请输入联系号码',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[6]) {
						uni.showToast({
							title: '请设置地址',
							icon: 'none'
						});
						return false;
					}
					let phoneReg = /^1\d{10}$/;
					if (!phoneReg.test(this.val[3])) {
						uni.showToast({
							title: '填写手机号位数不对',
							icon: 'none'
						})
						return
					}
					if (!this.area[0]) {
						uni.showToast({
							title: '请选择地区',
							icon: 'none'
						});
						return false;
					}
					if (this.processingTechnology == '') {
						uni.showToast({
							title: '请选择加工工艺',
							icon: 'none'
						});
						return false;
					}
					let processingTechnologyArray = this.processingTechnology.split('、');
					// console.log(processingTechnologyArray);
					if (processingTechnologyArray.length > 10) {
						uni.showToast({
							title: '加工工艺最多选择十个',
							icon: 'none'
						});
						return false;
					}

					let materialsArray = this.materials.split('、');
					// console.log(materialsArray);
					if (materialsArray.length > 10) {
						uni.showToast({
							title: '加工材料最多选择十个',
							icon: 'none'
						});
						return false;
					}

					let serviceIndustryArray = this.serviceIndustry.trim().split('、');
					// console.log(serviceIndustryArray);
					if (serviceIndustryArray.length > 5) {
						uni.showToast({
							title: '行业领域最多选择5个',
							icon: 'none'
						});
						return false;
					}

					let certificateArray = this.certificate.trim().split('、');
					// console.log(certificateArray);
					if (certificateArray.length > 10) {
						uni.showToast({
							title: '资质证书最多选择10个',
							icon: 'none'
						});
						return false;
					}

					if (!this.orderType) {
						uni.showToast({
							title: '请选择可接受订单类型',
							icon: 'none'
						});
						return false;
					}
					if (this.employeesNum === -1) {
						uni.showToast({
							title: '请选择员工数量',
							icon: 'none'
						});
						return false;
					}
					if (this.yearNum === -1) {
						uni.showToast({
							title: '请选择年产值',
							icon: 'none'
						});
						return false;
					}
					if (this.areaNum === -1) {
						uni.showToast({
							title: '请选择工厂面积',
							icon: 'none'
						});
						return false;
					}
					if (this.isPassed == false) {
						uni.pageScrollTo({
							scrollTop: 0, //滚动到距离顶部为0
							duration: 500 //滚动时长
						})
						uni.showToast({
							title: '未通过工商认证',
							icon: 'none'
						});
						return false;
					}
					let that = this
					uni.requestSubscribeMessage({
						tmplIds: ['92OIalTSykZRY_WjSV0KahZNSwxMLTE4RhnC3lzAIgw'],
						complete() {
							that.submitIndex = 1
							uni.pageScrollTo({
								scrollTop: 0,
								duration: 0
							});
						}
					})
				} catch (err) {
					uni.showToast({
						title: err.message,
						icon: 'none',
						duration: 3000
					});
					this.setErrorLog(err)
				}

			},
			onSub() {
				if (this.info.status == 2) {
					this.time = new Date().getTime()
					this.show = true
				} else {
					this.show = true
					// this.getSubmit()
				}
			},
			// 提交
			getSubmit() {
				try {
					if (!this.val[0]) {
						uni.showToast({
							title: '请输入企业名称',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[1]) {
						uni.showToast({
							title: '请上传营业执照',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[2]) {
						uni.showToast({
							title: '请输入负责人',
							icon: 'none'
						});
						return false;
					}
					if (!this.val[3]) {
						uni.showToast({
							title: '请输入联系号码',
							icon: 'none'
						});
						return false;
					}
					let phoneReg = /^1\d{10}$/;
					if (!phoneReg.test(this.val[3])) {
						uni.showToast({
							title: '填写手机号位数不对',
							icon: 'none'
						})
						return
					}
					if (!this.area[0]) {
						uni.showToast({
							title: '请选择地区',
							icon: 'none'
						});
						return false;
					}
					console.log(this.processingTechnology == '')
					if (this.processingTechnology == '') {
						console.log(this.processingTechnology)
						uni.showToast({
							title: '请选择加工工艺',
							icon: 'none'
						});
						return false;
					}
					if (!this.orderType) {
						uni.showToast({
							title: '请选择可接受订单类型',
							icon: 'none'
						});
						return false;
					}
					if (this.employeesNum === -1) {
						uni.showToast({
							title: '请选择员工数量',
							icon: 'none'
						});
						return false;
					}
					if (this.yearNum === -1) {
						uni.showToast({
							title: '请选择年产值',
							icon: 'none'
						});
						return false;
					}
					if (this.areaNum === -1) {
						uni.showToast({
							title: '请选择工厂面积',
							icon: 'none'
						});
						return false;
					}
					if (this.equipmentList.length !== this.equipmentList.filter(item => item.name).length) {
						uni.showToast({
							title: '请输入设备名称',
							icon: 'none'
						});
						return false;
					}
					if (this.equipmentList.length !== this.equipmentList.filter(item => item.number).length) {
						uni.showToast({
							title: '请输入设备数量',
							icon: 'none'
						});
						return false;
					}

					this.show = false
					let ifFirstPopup = uni.getStorageSync('ifFirstPopup')
					if (!ifFirstPopup) {
						this.showNotice = true
						uni.setStorageSync('ifFirstPopup', true)
					}
					this.showNotice = false
					this.showTipImage = true
					const self = this
					uni.requestSubscribeMessage({
						tmplIds: ['X5UgYbTKPQn_PmMMUKoZOV7iH_ON5vpemjP4QThHFjo'],
						complete() {
							self.showTipImage = false
							self.submit()
						}
					})
				} catch (err) {
					uni.showToast({
						title: err.message,
						icon: 'none',
						duration: 3000
					});
					this.setErrorLog(err)
				}

			},
			setErrorLog(err) {
				let userInfo = uni.getStorageSync('userInfo')
				let data = {
					app_version: "",
					platform: "",
					os_version: "",
					device_model: "",
					error_type: "JS_ERROR",
					error_message: err.message,
					stack_trace: err,
					page_url: "",
					uid: "",
					network_type: "",
					api_url: "",
					api_params: "",
					custom_data: {}
				}
				const pages = getCurrentPages();
				const currentPage = pages[pages.length - 1]
				data.page_url = currentPage.route
				data.uid = userInfo.id
				uni.getSystemInfo({
					success: function(res) {
						data.app_version = res.appVersion
						data.platform = res.osName
						data.os_version = res.osVersion
						data.device_model = res.deviceModel
						console.log(res)
						data.custom_data = {
							romName: res.romName,
							romVersion: res.romVersion
						}
					}
				});
				uni.getNetworkType({
					success: function(res) {
						data.network_type = res.networkType
					}
				});
				// console.log(userInfo.id)
				// console.log(data)
				// return
				http.request('user/log', data).then((res) => {
					// uni.showToast({
					// 	title:res.message,
					// 	icon:"none"
					// })
				}).catch((err) => {
					uni.showToast({
						title: err?.message,
						icon: "none"
					})
				});
			},
			submit() {
				try {
					let equipmentLists = []
					let resultS = this.isPassed ? 1 : 0;
					if (Array.isArray(this.equipmentLists)) {
						equipmentLists = this.equipmentLists.filter(item => item.name != '')
					}
					let data = {
						company: this.val[0],
						business_license: this.val[1],
						province: this.area[0],
						city: this.area[1],
						person: this.val[2],
						mobile: this.val[3],
						county: this.area[2],
						address_title: this.val[6],
						address: this.val[4],
						house_number: this.val[5],
						latitude: this.latitude ? this.latitude : this.val[7],
						longitude: this.longitude ? this.longitude : this.val[8],
						// logo: this.logoUrl,
						machining_id: this.machiningList,
						order_type: this.typeChecked,
						staff: this.employeesNum === -1 ? 0 : this.employeesNumList[this.employeesNum].value,
						annual_output_value: this.yearNum === -1 ? 0 : this.yearNumList[this.yearNum].value,
						factory_area: this.areaNum === -1 ? 0 : this.areaNumList[this.areaNum].value,
						account_period_range: this.periodChecked,
						import_export_power: this.exportRights,
						processing_materials: this.materialsChecked,
						equipment: this.equipmentList,
						clientinfo: equipmentLists,
						qualification_id: this.certificateChecked,
						service_industry: this.serviceIndustryChecked,
						main_products: [], //this.productList
						// doorboard: this.doorboard,
						// equipment_img: this.equipment_img,
						// company_environment: this.imgList,
						introduction: this.companyIntroduction,
						//file_list: this.fileList,
						state: resultS,
						edit_type: 1
					};
					http.request('user/settledInfoApply', data).then((res) => {
						this.showTipImage = false
						uni.removeStorageSync('settledData')
						uni.reLaunch({
							url: '/pages/editSuccess/editSuccess'
						});
					}).catch((res) => {
						this.showTipImage = false
						uni.showToast({
							title: res.message,
							icon: 'none'
						});

					})
				}catch (err) {
					uni.showToast({
						title: err.message,
						icon: 'none',
						duration: 3000
					});
					this.setErrorLog(err)
				}
			},
			// 弹框显示
			onArea(e, _dataset) {
				/* ---处理dataset begin--- */
				this.handleDataset(e, _dataset);
				/* ---处理dataset end--- */
				let i = e.currentTarget.dataset.type;
				let status = this.show_list[i];
				this.setData({
					[`show_list[${i}]`]: !status,
					act: i
				});
			},
			//  弹框关闭
			onClose() {
				this.showNotice = false
				this.setData({
					show_list: [false, false, false]
				});
			},
			//  弹框确认点击
			confirm(e) {
				let act = this.act;
				switch (act) {
					case 0:
						this.setData({
							[`area[0]`]: e.detail.values[0].name,
							[`area[1]`]: e.detail.values[1].name,
							[`area[2]`]: e.detail.values[2].name,
						});
						this.onClose();
						break;
					case 1:
						this.setData({
							material_val: e.detail.value.name,
							material_id: e.detail.value.id
						});
						this.onClose();
						break;
					case 2:
						this.setData({
							type_val: e.detail.value.name,
							type_id: e.detail.value.id
						});
						this.onClose();
						break;
				}
			},
			// input显示
			onInput(e) {
				console.log(e.detail.value)
				let val = e.detail.value;
				let i = e.currentTarget.dataset.type;
				this.setData({
					[`val[${i}]`]: val
				});
			},
			onInputYY(e) {
				if (this.SySeach = true) {
					this.isPassed = false;
				}
				let val = e.detail.value;
				if (val.length < 4) {
					this.Result = []
					return;
				}
				const i = e.currentTarget.dataset.type;
				this.setData({
					[`val[${i}]`]: val,
				});
				// 清除之前的定时器
				if (this.timer) {
					clearTimeout(this.timer);
				}
				// 设置新的定时器，延迟500毫秒后执行
				this.timer = setTimeout(() => {
					if (val.length >= 4) {
						this.SySeach = true;
						http.request("/user/qichacha", {
							name: val
						}).then((res) => {
							console.log(res.data.Result.Data);
							this.Result = res.Result.Data;
							console.log(res.Result.Data);
						}).catch((err) => {
							this.Result = err.Result.Data;
							console.log(err.Result.Data.length);
						});
					} else {
						this.isPassed = false;
						this.SySeach = false
					}
				}, 100); // 延迟时间可以根据需要调整
			},
			handleFocus() {
				// if (this.val[0].length < 4) {
				// 	this.Result = []
				// 	return;
				// }
				if (this.val[0] && this.val[0].length >= 4) { // 如果输入框有值  
					this.SySeach = true;
					// 在获取焦点时使用 name: this.val[0]  
					http.request("user/qichacha", {
						name: this.val[0] // 使用 this.val[0] 作为名字参数  
					}).then((res) => {
						console.log(res.data.Result.Data);
						this.Result = res.data.Result.Data; // 确保访问正确的路径  
						console.log(this.Result);
					}).catch((err) => {
						console.error(err); // 打印错误信息  
						this.Result = err.Result.Data; // 确保访问正确的路径  
						console.log(err.Result.Data.length);
						if (err.Result.Data.length == 1) {
							this.setData({
								[`val[${0}]`]: err.Result.Data[0].Name
							});
							this.isPassed = true;
							this.SySeach = false
						}
					});
				}
			},
			onInputIntroduction(e) {
				this.companyIntroduction = e.detail.value;
			},
			// 获取配置
			getBase(dataList = false) {
				console.log(2222222222222);
				http.request('user/configData').then((res) => {
					console.log(res)
					this.setData({
						bese_info: res.data
					});
					const {
						order_type,
						account_period_range,
						staff,
						annual_output_value,
						factory_area,
						material,
						qualification,
						service_industry,
					} = res.data
					this.typeList = order_type
					this.periodList = account_period_range
					this.employeesNumList = staff
					this.yearNumList = annual_output_value
					this.areaNumList = factory_area
					this.materialList = material
					this.qualification = qualification
					this.service_industry = service_industry
					if (!dataList) {
						this.getInfo()
					} else {
						console.log(dataList.basic);
						console.log(dataList.company);
						if (dataList.states == false && dataList.company.length >= 4) {
							// this.SySeach = true;
							http.request("user/qichacha", {
								name: dataList.company
							}).then((res) => {
								console.log(res.data.Result.Data);
								console.log(res.data.Result.Data.length);
								if (res.data.Result.Data.length == 0) {
									this.val[0] = res.data.Result.Data; // 将长度为0的结果赋值给 this.val[0]  
								} else {
									this.Result = res.data.Result.Data; // 如果非零，存储到 Result 中  
								}
								console.log(this.Result);
							}).catch((res) => {
								console.log(res);
								console.log(res.Result.Data[0].Name);
								this.Result = res.Result.Data;
								if (res.Result.Data.length == 1) {
									this.val[0] = res.Result.Data[0].Name; // 将长度为0的结果赋值给 this.val[0]  
									this.isPassed = true
								} else {
									this.Result = res.data.Result.Data; // 如果非零，存储到 Result 中  
									this.SySeach = true;
								}
							});
						}
						this.val = [dataList.company, dataList.business_license, dataList.person, dataList.mobile,
							dataList.address, dataList.house_number, dataList.address_title,
						];
						this.isPassed = dataList.states
						this.basicResultS = dataList.basic
						this.area = [dataList.province, dataList.city, dataList.county];
						this.latitude = dataList.latitude
						this.longitude = dataList.longitude
						this.logoUrl = dataList.logo
						this.machiningList = dataList.machining_id ? JSON.parse(dataList.machining_id) : []
						this.typeChecked = dataList.order_type == null ? [] : dataList.order_type
						this.employeesNum = dataList.employeesNum
						this.yearNum = dataList.yearNum
						this.areaNum = dataList.areaNum
						this.periodChecked = dataList.account_period_range == null ? [] : dataList
							.account_period_range
						this.exportRights = dataList.import_export_power
						this.materialsChecked = dataList.processing_materials
						console.log(this.materialsChecked, "111");
						this.equipmentList = dataList.equipment == null || dataList.equipment.length == 0 ? [{
							name: '',
							model: '',
							brand: '',
							number: ''
						}] : dataList.equipment
						this.equipmentLists = dataList.clientinfo.length == 0 ? [{
							name: ''
						}] : dataList.clientinfo
						this.certificateChecked = dataList.qualification_id == null ? [] : dataList
							.qualification_id
						this.serviceIndustryChecked = dataList.service_industry || []
						this.productList = dataList.main_products.length == 0 ? [{
							name: '',
							machining: '',
							machining_id: [],
							material: '',
							material_id: [],
							url: ''
						}] : dataList.main_products
						console.log(dataList.main_products)
						this.doorboard = dataList.doorboard
						this.equipment_img = dataList.equipment_img || []
						this.imgList = dataList.company_environment
						this.companyIntroduction = dataList.introduction
						this.fileList = dataList.file_list || []
						try {
							let nameList = []
							this.qualification.forEach((item, index) => {
								if (this.certificateChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.certificate = nameList.join("、")
							nameList = []
							this.service_industry.forEach((item, index) => {
								if (this.serviceIndustryChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.serviceIndustry = nameList.join("、")
							nameList = []
							this.bese_info.machining.forEach(res => {
								res.children.forEach(item => {
									if (this.machiningList.includes(item.id)) {
										nameList.push(item.name)
									}
								})
							})
							// this.processingTechnology = nameList.join("、")
							nameList = []
							this.typeList.forEach((item, index) => {
								if (this.typeChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.orderType = nameList.join("、")
							nameList = []
							this.periodList.forEach((item, index) => {
								if (this.periodChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.accountingPeriod = nameList.join("、")
							nameList = []
							this.materialList.forEach((item, index) => {
								if (this.materialsChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.materials = nameList.join("、")
							this.productList.forEach((item, index) => {
								nameList = []
								this.materialList.forEach((v, i) => {
									if (item.material_id.includes(v.id)) {
										nameList.push(v.name)
									}
								})
								this.productList[index].material = nameList.join("、")
								nameList = []
								this.bese_info.machining.forEach((res, i) => {
									res.children.forEach(v => {
										if (item.machining_id.includes(v.id)) {
											nameList.push(v.name)
										}
									})
								})
								this.productList[index].machining = nameList.join("、")
							})
						} catch (res) {
							console.log(res)
						}
					}
				}).catch((res) => {
					uni.showToast({
						title: res.message,
						icon: 'none'
					});
				});
			},
			forList(index, type, path) {
				console.log(path)
				this.compressImage(type == "imgList" ? this.uploadList[index] : this.equipmentImgList[index], this).then(
					res => {
						console.log()
						http.upLoadFile('base/uploadImg', 'image', res.path, {}).then((res) => {
							if (type === 'imgList') {
								this.imgList.push(res.data.url)
								if (index != this.uploadList.length - 1) {
									index++
									this.forList(index, type)
								}
							} else {
								this.equipment_img.push(res.data.url)
								if (index != this.equipmentImgList.length - 1) {
									index++
									this.forList(index, type)
								}
							}
							uni.hideLoading()
						}).catch((res) => {
							uni.showToast({
								title: res.message,
								icon: 'none'
							});
						});
					}).catch((res) => {
					console.log(res)
					uni.showToast({
						title: res,
						icon: 'none'
					});
				});
			},
			//  上传照片
			upImgArr(index, type = '') {
				console.log(type)
				console.log(index);
				let that = this;
				let count = 1
				let sizeType = ['compressed'];
				if (type == "imgList") {
					count = 9 - this.imgList.length
				} else if (type == 'equipment_img') {
					count = 9 - this.equipment_img.length
				}
				// if (type == 'logoUrl' || type == 'doorboard') {
				// 	sizeType.push('original'); // Add 'original' if type is imgList  
				// }
				uni.chooseImage({
					count,
					sizeType: sizeType,
					success(res) {
						uni.showLoading({
							title: '上传中'
						})
						console.log(sizeType);
						console.log(res.tempFiles)
						if (type == "imgList") {
							that.uploadList = res.tempFiles
							that.forList(0, type, res.tempFiles)
							console.log(2);
							return
						} else if (type == 'equipment_img') {
							that.equipmentImgList = res.tempFiles
							that.forList(0, type, res.tempFiles)
							console.log(3);
							return
						}
						http.upLoadFile('base/uploadImg', 'image', res.tempFiles[0].path, {}).then((res) => {
							console.log(res)
							// uni.hideLoading();
							if (type == 'doorboard') {
								// that.doorboard = res.data.url
								that.JIeq = res.data.url
								console.log(2);
								that.caijiIMg = true
								uni.hideLoading()
								// that.$refs.createImage.getImage()
								return
							} else if (type == 'product') {
								that.productList[index].url = res.data.url
								console.log(3);
								uni.hideLoading();
								return
							} else if (type == 'logoUrl') {
								that.JIeq = res.data.url
								uni.hideLoading()
								that.caijiIMg2 = true
								return
							} else if (index === 0) {
								that.setData({
									[`val[1]`]: res.data.url,
								});
								// uni.hideLoading();
							} else {
								that.logoUrl = res.data.url
								// uni.hideLoading()
							}
							uni.hideLoading();
						}).catch((res) => {
							uni.showToast({
								title: res.message,
								icon: 'none'
							});
						});

						console.log(res.tempFiles[0])
					}
				})
			},
			// 图片压缩
			compressImage(file, that) {
				return new Promise(function(resolve, reject) {
					let {
						path,
						size
					} = file;
					// 如果文件大小小于等于500 KB，直接返回  
					if (size <= 1024 * 500) {
						console.log("File size is less than or equal to 500 KB, resolving without compression.");
						return resolve(file);
					}
					uni.getImageInfo({
						src: path,
						success(res) {
							console.log(res);
							var originalWidth = res.width; // 原始宽度  
							var originalHeight = res.height; // 原始高度  
							var targetSize = 1024 * 500; // 目标大小为500 KB  
							var scale = 1; // 默认缩放比例  
							// 计算缩放比例  
							if (size > targetSize) {
								scale = Math.sqrt(size / targetSize); // 根据文件大小计算缩放比例  
							}
							// 计算新的宽高  
							var canvasWidth = Math.trunc(originalWidth / scale);
							var canvasHeight = Math.trunc(originalHeight / scale);
							console.log(`New canvas dimensions: ${canvasWidth}x${canvasHeight}`);
							that.cWidth = canvasWidth;
							that.cHeight = canvasHeight;
							var ctx = uni.createCanvasContext('canvas', that);
							// 计算绘制位置以居中图像  
							var xOffset = (canvasWidth - originalWidth / scale) / 2;
							var yOffset = (canvasHeight - originalHeight / scale) / 2;
							// 绘制图像  
							ctx.drawImage(res.path, xOffset, yOffset, originalWidth / scale,
								originalHeight / scale);
							ctx.draw(false, setTimeout(() => {
								uni.canvasToTempFilePath({
									canvasId: 'canvas',
									destWidth: canvasWidth,
									destHeight: canvasHeight,
									fileType: 'jpg',
									quality: 0.8, // 调整压缩质量  
									success: function(res1) {
										uni.getFileInfo({
											filePath: res1.tempFilePath,
											success: async (ress) => {
												console.log(
													`Compressed file size: ${ress.size / 1024} KB`
												);
												resolve(await that
													.compressImage({
														path: res1
															.tempFilePath,
														size: ress
															.size
													}, that));
											}
										});
									},
									fail: function(res) {
										reject(res.errMsg);
									}
								}, that);
							}, 100)); // 留一定的时间绘制canvas  
						},
						fail(err) {
							reject(err.errMsg);
						}
					});
				});
			},
			upFile() {
				let that = this;
				let count = 9 - this.fileList.length
				wx.getSystemInfo({
					success: (res) => {
						if (res.platform == 'android' || res.platform == 'ios') {
							uni.chooseMessageFile({
								count: count,
								type: 'file',
								success(res) {
									uni.showLoading({
										title: '上传中'
									});
									let up_length = 0;
									let list_length = res.tempFiles.length;
									for (let j = 0; j < res.tempFiles.length; j++) {
										let tempFiles = res.tempFiles[j];
										http.upLoadFile('base/getFile', 'file', tempFiles.path, {})
											.then((res) => {
												up_length = up_length + 1;
												that.fileList.push({
													url: res.data.file,
													name: tempFiles.name
												})
												if (up_length == list_length) {
													uni.hideLoading();
												}
											}).catch((res) => {
												uni.hideLoading();
												uni.showToast({
													title: res.message,
													icon: 'none'
												});
											});
									}
								},
								fail(res) {
									uni.hideLoading();
								}
							});
						} else {
							this.showToast = true
						}
					}
				});
			},
			// 删除图片
			onDel(e, type) {
				if (type == 'imgList') {
					this.imgList.splice(e, 1)
				} else if (type == 'equipment_img') {
					this.equipment_img.splice(e, 1)
				} else if (type == 'doorboard') {
					this.doorboard = ''
				} else if (type == 'product') {
					this.productList[e].url = ''
				} else if (type == 'fileList') {
					this.fileList.splice(e, 1)
				} else if (e === 0) {
					this.setData({
						[`val[1]`]: ''
					});
				} else {
					this.logoUrl = ''
				}
			},
			// 预览
			preview(event) {
				let currentUrl = event.target.dataset.src;
				uni.previewImage({
					current: currentUrl,
					// 当前显示图片的http链接
					urls: [currentUrl] // 需要预览的图片http链接列表
				});
			},
			getInfo() {
				http.request('user/settledInfo', {
					type: 1
				}).then((res) => {
					let basicN = res.data.info.basic
					// console.log(res.data.info.basic, basicN == 'null');
					let data = res.data.info
					let status = data.detail
					let jsonObject;
					// let jsonObject = JSON.parse(data.basic)
					if (basicN != 'null') {
						jsonObject = JSON.parse(data.basic)
					}
					if (data.company) {
						// console.log(data.company, "company")
						if (status.status == 1 || status.status == 3) {
							this.info_show = true
						} else {
							this.info_show = false
						}
						// console.log(this.info_show, '1111111111111111111111')
						this.setData({
							[`val[0]`]: data.company,
							[`val[1]`]: data.business_license,
							[`val[2]`]: data.person,
							[`val[3]`]: data.mobile,
							[`val[4]`]: data.address,
							[`val[5]`]: data.house_number,
							[`val[6]`]: data.address_title,
							['area[0]']: data.province,
							['area[1]']: data.city,
							['area[2]']: data.county,
						});
					}
					let statey = data.state
					// console.log(statey);/
					if (statey) {
						this.isPassed = true
						this.setData({
							[`val[0]`]: data.company,
							[`val[1]`]: data.business_license,
							[`val[2]`]: data.person,
							[`val[3]`]: data.mobile,
							[`val[4]`]: data.address,
							[`val[5]`]: data.house_number,
							[`val[6]`]: data.address_title,
							[`val[7]`]: data.latitude,
							[`val[8]`]: data.longitude,
							['area[0]']: data.province,
							['area[1]']: data.city,
							['area[2]']: data.county,
						});
						this.machiningList = data.machining_id ? JSON.parse(data.machining_id) : []
						this.processingTechnology = res.data.info.machining.join('、')
					}
					if (!statey) {
						this.isPassed = false
						this.setData({
							[`val[0]`]: data.company,
							[`val[1]`]: data.business_license,
							[`val[2]`]: data.person,
							[`val[3]`]: data.mobile,
							[`val[4]`]: data.address,
							[`val[5]`]: data.house_number,
							[`val[6]`]: data.address_title,
							['area[0]']: data.province,
							['area[1]']: data.city,
							['area[2]']: data.county,
						});
						this.machiningList = data.machining_id ? JSON.parse(data.machining_id) : []
						this.processingTechnology = res.data.info.machining.join('、')
					}
					if (statey == 0 && data.company.length >= 4) {
						http.request("user/qichacha", {
							name: data.company
						}).then((res) => {
							// console.log(res.data.Result.Data);
							this.Result = res.data.Result.Data;
							// console.log(this.Result);
						}).catch((err) => {
							// console.log(err);
							this.Result = err.Result.Data;
							if (err.Result.Data.length == 1) {
								this.val[0] = err.Result.Data[0].Name; // 将长度为0的结果赋值给 this.val[0]  
								this.isPassed = true
							} else {
								this.Result = err.data.Result.Data; // 如果非零，存储到 Result 中  
								this.SySeach = true;
							}
							// console.log(this.Result);
						});
					}
					console.log(this.typeChecked)

					//之前 !statey
					if (!statey) {
						data = {
							...data,
							...data.detail
						}
						this.latitude = data.latitude
						this.longitude = data.longitude
						this.logoUrl = data.logo
						this.machiningList = data.machining_id ? JSON.parse(data.machining_id) : []
						this.processingTechnology = data.machining.join('、')
						this.typeChecked = data.order_type == null ? [] : data.order_type
						console.log(this.typeChecked)
						this.orderType = data.infoName.order_type.join('、')
						this.employeesNum = this.employeesNumList.map(item => item.value).indexOf(data.staff)
						this.yearNum = this.yearNumList.map(item => item.value).indexOf(data.annual_output_value)
						this.areaNum = this.areaNumList.map(item => item.value).indexOf(data.factory_area)
						this.periodChecked = data.account_period_range == null ? [] : data.account_period_range
						this.accountingPeriod = data.infoName.account_period_range.join('、')
						this.exportRights = data.import_export_power
						this.materialsChecked = data.processing_materials == null ? [] : data.processing_materials
						console.log(this.materialsChecked, '111');
						this.materials = data.infoName.processing_materials.join('、')
						this.equipmentList = data.equipment == null || data.equipment.length == 0 ? [{
							name: '',
							model: '',
							brand: '',
							number: ''
						}] : data.equipment
						this.equipmentLists = !data.clientinfo && data.clientinfo.length == 0 ? [{
							name: ''
						}] : equipmentLists
						this.certificateChecked = data.qualification_id || []
						this.certificate = data.infoName.qualification.join('、')
						this.productList = data.main_products || []
						console.log(data.main_products, 1212121)
						this.serviceIndustryChecked = data.service_industry || []
						this.doorboard = data.doorboard
						this.equipment_img = data.equipment_img || []
						this.imgList = data.company_environment || []
						this.companyIntroduction = data.introduction
						this.fileList = data.file_list || []
						try {
							let nameList = []
							this.qualification.forEach((item, index) => {
								if (this.certificateChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							console.log(data.qualification_id)
							console.log(this.certificateChecked)
							this.certificate = nameList.join("、")
							nameList = []
							this.service_industry.forEach((item, index) => {
								if (this.serviceIndustryChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.serviceIndustry = nameList.join("、")
							nameList = []
							this.bese_info.machining.forEach(res => {
								res.children.forEach(item => {
									if (this.machiningList.includes(item.id)) {
										nameList.push(item.name)
									}
								})
							})
							this.processingTechnology = nameList.join("、")
							nameList = []
							this.typeList.forEach((item, index) => {
								if (this.typeChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.orderType = nameList.join("、")
							nameList = []
							this.periodList.forEach((item, index) => {
								if (this.periodChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.accountingPeriod = nameList.join("、")
							nameList = []
							this.materialList.forEach((item, index) => {
								if (this.materialsChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.materials = nameList.join("、")
							this.productList.forEach((item, index) => {
								nameList = []
								this.materialList.forEach((v, i) => {
									if (item.material_id.includes(v.id)) {
										nameList.push(v.name)
									}
								})
								this.productList[index].material = nameList.join("、")
								nameList = []
								this.bese_info.machining.forEach((res, i) => {
									res.children.forEach(v => {
										if (item.machining_id.includes(v.id)) {
											nameList.push(v.name)
										}
									})
								})
								this.productList[index].machining = nameList.join("、")
							})
						} catch (res) {
							console.log(res)
						}
					}
					if (statey) {
						console.log(this.typeChecked)
						data = {
							...data,
							...data.detail
						}
						this.basicResultS = res.data.info.basic
						this.basicName = jsonObject.Name
						this.basicResult = jsonObject.Result
						this.basicAddress = jsonObject.Address
						this.basicOperName = jsonObject.OperName
						this.basicEconKind = jsonObject.EconKind
						this.basicStartDate = jsonObject.StartDate
						this.basicRegistCapi = jsonObject.RegistCapi
						this.basicCreditCode = jsonObject.CreditCode
						this.basicStatus = jsonObject.Status
						this.basicRecCap = jsonObject.RecCap
						this.basicScope = jsonObject.Scope
						this.basicNo = jsonObject.basicNo
						this.latitude = data.latitude
						this.longitude = data.longitude
						this.logoUrl = data.logo
						// console.log(this.machiningList)
						this.processingTechnology = data.machining.join('、')
						this.typeChecked = data.order_type == null ? [] : data.order_type
						this.orderType = data.infoName.order_type.join('、')
						// console.log(this.orderType)
						this.employeesNum = this.employeesNumList.map(item => item.value).indexOf(data.staff)
						this.yearNum = this.yearNumList.map(item => item.value).indexOf(data.annual_output_value)
						this.areaNum = this.areaNumList.map(item => item.value).indexOf(data.factory_area)
						this.periodChecked = data.account_period_range == null ? [] : data.account_period_range
						this.accountingPeriod = data.infoName.account_period_range.join('、')
						this.exportRights = data.import_export_power
						this.materialsChecked = data.processing_materials == null ? [] : data.processing_materials
						console.log(this.materialsChecked, '111');
						this.materials = data.infoName.processing_materials.join('、')
						this.equipmentList = data.equipment == null || data.equipment.length == 0 ? [{
							name: '',
							model: '',
							brand: '',
							number: ''
						}] : data.equipment
						this.equipmentLists = data.clientinfo && data.clientinfo.length == 0 ? [{
							name: ''
						}] : data.clientinfo
						// console.log(dataList.clientinfo)
						this.certificateChecked = data.qualification_id == null ? [] : data.qualification_id
						this.certificate = data.infoName.qualification.join('、')
						this.productList = data.main_products.length == 0 ? [{
							name: '',
							machining: '',
							machining_id: [],
							material: '',
							material_id: [],
							url: ''
						}] : data.main_products
						console.log(data.main_products)
						this.serviceIndustryChecked = data.service_industry || []
						this.doorboard = data.doorboard
						this.equipment_img = data.equipment_img || []
						this.imgList = data.company_environment || []
						this.companyIntroduction = data.introduction
						this.fileList = data.file_list || []
						this.machiningList = data.machining_id
						try {
							let nameList = []
							this.qualification.forEach((item, index) => {
								if (this.certificateChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							console.log(data.qualification_id)
							console.log(this.certificateChecked)
							this.certificate = nameList.join("、")
							nameList = []
							this.service_industry.forEach((item, index) => {
								if (this.serviceIndustryChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.serviceIndustry = nameList.join("、")
							nameList = []
							this.bese_info.machining.forEach(res => {
								res.children.forEach(item => {
									if (this.machiningList.includes(item.id)) {
										nameList.push(item.name)
									}
								})
							})
							this.processingTechnology = nameList.join("、")
							nameList = []
							this.typeList.forEach((item, index) => {
								if (this.typeChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.orderType = nameList.join("、")
							nameList = []
							this.periodList.forEach((item, index) => {
								if (this.periodChecked.includes(item.value)) {
									nameList.push(item.text)
								}
							})
							this.accountingPeriod = nameList.join("、")
							nameList = []
							this.materialList.forEach((item, index) => {
								if (this.materialsChecked.includes(item.id)) {
									nameList.push(item.name)
								}
							})
							this.materials = nameList.join("、")
							this.productList.forEach((item, index) => {
								nameList = []
								this.materialList.forEach((v, i) => {
									if (item.material_id.includes(v.id)) {
										nameList.push(v.name)
									}
								})
								this.productList[index].material = nameList.join("、")
								nameList = []
								this.bese_info.machining.forEach((res, i) => {
									res.children.forEach(v => {
										if (item.machining_id.includes(v.id)) {
											nameList.push(v.name)
										}
									})
								})
								this.productList[index].machining = nameList.join("、")
							})
						} catch (res) {
							console.log(res)
						}
					}
					console.log(data.company, "company")

					this.setData({
						info: {
							...data,
							my_status: status.status
						}
					});
				}).catch((err) => {
					console.log(err)
					// const data = {
					// 	...data,
					// 	...data.detail
					// }
					// this.processingTechnology = err.data.info.machining.join('、')
					// this.info = {...err.data.info,...err.data.info.detail}
					// if (this.info.status == 1 || this.info.status == 3) {
					// 	this.info_show = true
					// } else {
					// 	this.info_show = false
					// }

					// uni.showToast({
					// 	title: err.msg,
					// 	icon: 'none'
					// });
				});
			},
			onAgain() {
				this.setData({
					info_show: false
				});
			},
			// 返回
			onBack() {
				uni.redirectTo({
					url: "/pages/my/my"
				})
				// uni.navigateBack({
				// 	delta: 2
				// });
			}
		}
	};
</script>
<style lang="scss">
	// .van-action-sheet__header{
	// 	position: fixed;
	// 	top: 0;
	// }
	@import '../settled/settled.css';

	.CQbutton {
		display: flex;
		justify-content: space-around;

		button {
			color: white;
			background: none;
		}
	}

	.container {
		/** 外层一定要指定大小 */
		height: 100vh;
	}

	.caiJ {
		position: fixed;
		top: 0;
		width: 100%;
		height: 100vh;
		background: black;
		z-index: 99999;
	}

	.BusiN-t {
		display: flex;
		text-align: center;
		font-size: 13px;
		line-height: 30px;
		width: 100%;
		border-top: 1px solid gainsboro;

		.Busi-left {
			background-color: #cef6fc;
			width: 34%;
			border-right: 1px solid gainsboro;
		}

		.Busi-right {
			width: 64%;
			padding: 0 1%;
		}
	}

	.popup-content {
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: center;
		padding: 15px;
		height: 50px;
		background-color: #fff;
	}

	.popup-height {
		height: 100%;
		flex: 1;
		width: 200px;
	}

	.search-D {
		position: absolute;
		top: 120%;
		background: white;
		width: 100%;
		z-index: 12;
		box-shadow: 0 3px 5px 0 rgba(0, 0, 0, .1);
		border-radius: 0 0 10px 10px;
		font-size: 14px;
		display: flex;
		flex-direction: column;

		.titleName {
			line-height: 30px;
			padding: 6px 0 6px 6px;
			border-bottom: 1px solid gainsboro;
		}
	}

	.passed {
		// margin-top: 5rpx;
		position: relative;
		width: 50rpx;
		height: 50rpx;
		margin-left: 15rpx;

		image {
			width: 100%;
			height: 100%;
		}

		.pd_tab {
			position: absolute;
			bottom: -60rpx;
			right: 0rpx;
			width: 160rpx;
			height: 68rpx;
			box-sizing: border-box;
			color: #fff;
			z-index: 22;
		}

		.active_pd {
			background-color: #0E932E !important;
		}
	}

	.choosedType {
		color: #FFF !important;
		background-color: #1050c7 !important;
	}

	.submitBtn {
		height: 130rpx;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.submitBtn>view {
		background-color: #1050c7;
		width: 690rpx;
		font-weight: 500;
		color: #FFF;
		text-align: center;
		font-size: 32rpx;
		line-height: 96rpx;
		border-radius: 200rpx;
	}

	.xPopupTitle {
		font-weight: bold;
		font-size: 32rpx;
		text-align: center;
		padding: 30rpx 0 30rpx;
	}

	.selectBox {
		display: flex;
		width: 690rpx;
		margin: 0 auto 50rpx;
		flex-wrap: wrap;
		max-height: 600rpx;
		overflow: auto;
	}

	.selectBox>view {
		margin-bottom: 15rpx;
		margin-right: 15rpx;
		min-width: 220rpx;
		line-height: 66rpx;
		height: 66rpx;
		background: #F7F7F7;
		border-radius: 6rpx 6rpx 6rpx 6rpx;
		font-size: 26rpx;
		color: #000000;
		text-align: center;
		transition: all .3s linear;
	}

	.selectBox>view:nth-child(3n) {
		margin-right: 0;
	}

	.tips {
		margin-top: 4rpx;
		font-size: 28rpx;
	}

	.share-but1 {
		width: 50% !important;
		font-size: 32rpx;
		padding: 0 !important;
		margin: 0 !important;
		font-weight: 400;
		text-align: center;
		color: #283043;
		line-height: 96rpx;
		border-left: 1rpx solid #ebedf0;
	}

	.add {
		font-size: 28rpx !important;
		padding-left: 20rpx;
		margin-bottom: 30rpx;
	}

	.red {
		color: red
	}

	.input {
		border: 1px solid #ebedf0;
		padding: 6rpx 10rpx;
		border-radius: 15rpx;
	}

	.input.blue {
		background-color: #1050c7;
		font-weight: bolder;
		border: none;
	}
</style>